package com.xiaozhuyao.service.impl;

import com.xiaozhuyao.bean.User;
import com.xiaozhuyao.dao.UserMapper;
import com.xiaozhuyao.service.IUserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;


@Service("iUserService")
public class UserServiceImpl implements IUserService {

    @Autowired
   private UserMapper userMapper;

    public int addUser(User user){
      int a=  userMapper.insert(user);
        return a;
    }
    public  User selectUser(String uuid){
        User user=userMapper.selectByPrimaryKey(uuid);
        return user;
    }
    @Test
    public void test1(){
        User user=new User();
        user.setUuid(UUID.randomUUID().toString());
        user.setPassword("admin");
        user.setUsername("admin");
        userMapper.insert(user);
    }
    @Test
    public  void tets1(){
     User user=   userMapper.selectByPrimaryKey("4f7beaba260045f899acbdcdc11947a2");
     System.out.println(user.toString());
    }

}
